<template>
    <el-form :model="Scientific_Research_Contest_and_Integrated_Curriculum_Reform" label-position="top" size="large" ref="Scientific_Research_Contest_and_Integrated_Curriculum_Reform_form">
        <el-tabs v-model="ActiveTab">
            <el-scrollbar style="height: calc(100vh - 165px)">


                <el-tab-pane label="科研课题" name="科研课题">
                    <el-row justify="center" style="margin-top: 50px">
                        <el-col :xs="24" :sm="22" :md="20" :lg="18" :xl="16">
                            <el-row v-for="(item, index) of Scientific_Research_Contest_and_Integrated_Curriculum_Reform.rm_scienceresearch" justify="space-between">
                                <el-col :span="24">
                                    <el-row justify="space-between" :gutter="16">
                                        <el-col :xs="12" :sm="10" :md="8" :lg="6" :xl="5">
                                            <el-form-item label="名称" :prop="`rm_scienceresearch.${index}.s_name`" :rules="{required: true, message: '请输入-科研课题-名称', trigger: 'blur'}">
                                                <el-input placeholder="请输入名称" v-model="item.s_name"></el-input>
                                            </el-form-item>
                                        </el-col>
                                        <el-col :xs="12" :sm="10" :md="8" :lg="6" :xl="5">
                                            <el-form-item label="级别" :prop="`rm_scienceresearch.${index}.s_level`" :rules="{required: true, message: '请输入-科研课题-级别', trigger: 'blur'}">
                                                <el-input placeholder="请输入级别" v-model="item.s_level"></el-input>
                                            </el-form-item>
                                        </el-col>
                                        <el-col :xs="12" :sm="10" :md="8" :lg="6" :xl="5">
                                            <el-form-item label="立项单位" :prop="`rm_scienceresearch.${index}.s_initiationunit`" :rules="{required: true, message: '请输入-科研课题-立项单位', trigger: 'blur'}">
                                                <el-input placeholder="请输入立项单位" v-model="item.s_initiationunit"></el-input>
                                            </el-form-item>
                                        </el-col>
                                        <el-col :xs="12" :sm="10" :md="8" :lg="6" :xl="5">
                                            <el-form-item label="是否主持/参与？" :prop="`rm_scienceresearch.${index}.s_ishost`" :rules="{required: true, message: '请选择-科研课题-是否主持/参与？', trigger: 'blur'}">
                                                <el-radio-group v-model="item.s_ishost">
                                                    <el-radio-button @click="item.s_number = '' ;item.s_position = ''" :label="true">主持</el-radio-button>
                                                    <el-radio-button :label="false">参与</el-radio-button>
                                                </el-radio-group>
                                            </el-form-item>
                                        </el-col>
                                    </el-row>
                                </el-col>
                                <el-col :span="24">
                                    <el-row justify="space-between" :gutter="16">
                                        <el-col :xs="12" :sm="10" :md="8" :lg="6" :xl="5">
                                            <el-form-item label="立项时间" :prop="`rm_scienceresearch.${index}.s_starttime`" :rules="{required: true, message: '请选择-科研课题-立项时间', trigger: 'blur'}">
                                                <el-date-picker placeholder="请选择立项时间" type="date" value-format="YYYY.MM.DD" v-model="item.s_starttime"></el-date-picker>
                                            </el-form-item>
                                        </el-col>
                                        <el-col :xs="12" :sm="10" :md="8" :lg="6" :xl="5">
                                            <el-form-item label="结项时间" :prop="`rm_scienceresearch.${index}.s_endtime`" :rules="{required: true, message: '请选择-科研课题-结项时间', trigger: 'blur'}">
                                                <el-date-picker placeholder="请选择结项时间" value-format="YYYY.MM.DD" v-model="item.s_endtime"></el-date-picker>
                                            </el-form-item>
                                        </el-col>
                                        <el-col :xs="12" :sm="10" :md="8" :lg="6" :xl="5">
                                            <el-form-item label="共*人/第*位" :prop="`rm_scienceresearch.${index}.s_position`" :rules="!item.s_ishost ? {required: true, message: '请输入-科研课题-人数/位次', trigger: 'blur'}:''">
                                                <el-col :span="12" style="padding: 0">
                                                    <el-input-number :min="0" style="width: 100%" placeholder="共*人" v-model="item.s_number" controls-position="right" :disabled="item.s_ishost"></el-input-number>
                                                </el-col>
                                                <el-col :span="12" style="padding: 0">
                                                    <el-input-number :min="0" :max="Number(item.s_number)" style="width: 100%" placeholder="第*位" v-model="item.s_position" controls-position="right"  :disabled="item.s_ishost"></el-input-number>
                                                </el-col>
                                            </el-form-item>
                                        </el-col>
                                        <el-col :xs="12" :sm="10" :md="8" :lg="6" :xl="5">
                                            <el-button type="danger" style="margin-top: 34px" @click="remove_btn('scienceresearch', index)">删除此项</el-button>
                                        </el-col>
                                    </el-row>
                                </el-col>
                                <div class="line"></div>
                            </el-row>
                            <el-button class="add_btn" type="primary" @click="add_btn('scienceresearch')">添加</el-button>
                        </el-col>
                    </el-row>
                </el-tab-pane>


                <el-tab-pane label="论文" name="论文">
                    <el-row justify="center" style="margin-top: 50px">
                        <el-col :xs="24" :sm="22" :md="20" :lg="18" :xl="16">
                            <el-row justify="space-between" v-for="(item, index) of Scientific_Research_Contest_and_Integrated_Curriculum_Reform.rm_paper">
                                <el-col :span="24">
                                    <el-row justify="space-between" :gutter="16">
                                        <el-col  :xs="12" :sm="10" :md="8" :lg="6" :xl="5">
                                            <el-form-item label="名称" :prop="`rm_paper.${index}.p_name`" :rules="{required: true, message: '请输入-论文-名称', trigger: 'blur'}">
                                                <el-input placeholder="请输入名称" v-model="item.p_name"></el-input>
                                            </el-form-item>
                                        </el-col>
                                        <el-col  :xs="12" :sm="10" :md="8" :lg="6" :xl="5">
                                            <el-form-item label="等级" :prop="`rm_paper.${index}.p_level`" :rules="{required: true, message: '请输入-论文-等级', trigger: 'blur'}">
                                                <el-input placeholder="请输入等级" v-model="item.p_level"></el-input>
                                            </el-form-item>
                                        </el-col>
                                        <el-col  :xs="12" :sm="10" :md="8" :lg="6" :xl="5">
                                            <el-form-item label="刊物/出版社" :prop="`rm_paper.${index}.p_publisher`" :rules="{required: true, message: '请输入-论文-刊物/出版社', trigger: 'blur'}">
                                                <el-input placeholder="请输入刊物/出版社" v-model="item.p_publisher"></el-input>
                                            </el-form-item>
                                        </el-col>
                                        <el-col  :xs="12" :sm="10" :md="8" :lg="6" :xl="5">
                                            <el-form-item label="级别" :prop="`rm_paper.${index}.p_rank`" :rules="{required: true, message: '请输入-论文-级别', trigger: 'blur'}">
                                                <el-input placeholder="请输入级别" v-model="item.p_rank"></el-input>
                                            </el-form-item>
                                        </el-col>
                                    </el-row>
                                </el-col>
                                <el-col :span="24">
                                    <el-row justify="space-between" :gutter="16">
                                        <el-col  :xs="12" :sm="10" :md="8" :lg="6" :xl="5">
                                            <el-form-item label="时间" :prop="`rm_paper.${index}.p_time`" :rules="{required: true, message: '请选择-论文-时间', trigger: 'blur'}">
                                                <el-date-picker placeholder="请选择时间" value-format="YYYY.MM.DD" v-model="item.p_time"></el-date-picker>
                                            </el-form-item>
                                        </el-col>
                                        <el-col  :xs="12" :sm="10" :md="8" :lg="6" :xl="5">
                                            <el-form-item label="共*人" :prop="`rm_paper.${index}.p_number`" :rules="{required: true, message: '请输入-论文-人数', trigger: 'blur'}">
                                                <el-input-number placeholder="请输入人数" :min="0" v-model="item.p_number"></el-input-number>
                                            </el-form-item>
                                        </el-col>
                                        <el-col  :xs="12" :sm="10" :md="8" :lg="6" :xl="5">
                                            <el-form-item label="第*位" :prop="`rm_paper.${index}.p_position`" :rules="{required: true, message: '请输入-论文-位次', trigger: 'blur'}">
                                                <el-input-number placeholder="请输入位次" :min="0" :max="Number(item.p_number)" v-model="item.p_position"></el-input-number>
                                            </el-form-item>
                                        </el-col>
                                        <el-col  :xs="12" :sm="10" :md="8" :lg="6" :xl="5">
                                            <el-button type="danger" style="margin-top: 34px" @click="remove_btn('paper', index)">删除此项</el-button>
                                        </el-col>
                                    </el-row>
                                </el-col>
                                <div class="line"></div>
                            </el-row>
                            <el-button class="add_btn" type="primary" @click="add_btn('paper')">添加</el-button>
                        </el-col>
                    </el-row>
                </el-tab-pane>


                <el-tab-pane label="专利" name="专利">
                    <el-row justify="center" style="margin-top: 50px">
                        <el-col :xs="24" :sm="22" :md="20" :lg="18" :xl="16">
                            <el-row justify="space-between" v-for="(item, index) of Scientific_Research_Contest_and_Integrated_Curriculum_Reform.rm_patent">
                                <el-col :span="24">
                                    <el-row justify="space-between" :gutter="16">
                                        <el-col :xs="12" :sm="10" :md="8" :lg="6" :xl="4">
                                            <el-form-item label="专利名称" :prop="`rm_patent.${index}.pa_name`" :rules="{required: true, message: '请输入-专利-名称', trigger: 'blur'}">
                                                <el-input placeholder="请输入专利名称" v-model="item.pa_name"></el-input>
                                            </el-form-item>
                                        </el-col>
                                        <el-col  :xs="12" :sm="10" :md="8" :lg="6" :xl="4">
                                            <el-form-item label="类别" :prop="`rm_patent.${index}.pa_class`" :rules="{required: true, message: '请输入-专利-类别', trigger: 'blur'}">
                                                <el-input placeholder="请输入类别" v-model="item.pa_class"></el-input>
                                            </el-form-item>
                                        </el-col>
                                        <el-col  :xs="12" :sm="10" :md="8" :lg="6" :xl="4">
                                            <el-form-item label="时间" :prop="`rm_patent.${index}.pa_time`" :rules="{required: true, message: '请选择-专利-时间', trigger: 'blur'}">
                                                <el-date-picker placeholder="请选择时间" value-format="YYYY.MM.DD" v-model="item.pa_time"></el-date-picker>
                                            </el-form-item>
                                        </el-col>
                                        <el-col  :xs="12" :sm="10" :md="8" :lg="6" :xl="4">
                                            <el-form-item label="位次" :prop="`rm_patent.${index}.pa_position`" :rules="{required: true, message: '请输入-专利-位次', trigger: 'blur'}">
                                                <el-input-number placeholder="请输入位次" :min="0" v-model="item.pa_position"></el-input-number>
                                            </el-form-item>
                                        </el-col>
                                        <el-col :xs="12" :sm="10" :md="8" :lg="6" :xl="4">
                                            <el-button type="danger" style="margin-top: 34px" @click="remove_btn('patent', index)">删除此项</el-button>
                                        </el-col>
                                    </el-row>
                                </el-col>
                                <div class="line"></div>
                            </el-row>
                            <el-button class="add_btn" type="primary" @click="add_btn('patent')">添加</el-button>
                        </el-col>
                    </el-row>
                </el-tab-pane>


                <el-tab-pane label="著作教材" name="著作教材">
                    <el-row justify="center" style="margin-top: 50px">
                        <el-col :xs="24" :sm="22" :md="20" :lg="18" :xl="16">
                            <el-row justify="space-between" v-for="(item, index) of Scientific_Research_Contest_and_Integrated_Curriculum_Reform.rm_book">
                                <el-col :span="24">
                                    <el-row justify="space-between" :gutter="16">
                                        <el-col :xs="12" :sm="10" :md="8" :lg="6" :xl="5">
                                            <el-form-item label="著作教材名称" :prop="`rm_book.${index}.b_name`" :rules="{required: true, message: '请输入-著作教材-名称', trigger: 'blur'}">
                                                <el-input placeholder="请输入教材名称" v-model="item.b_name"></el-input>
                                            </el-form-item>
                                        </el-col>
                                        <el-col :xs="12" :sm="10" :md="8" :lg="6" :xl="5">
                                            <el-form-item label="类别" :prop="`rm_book.${index}.b_class`" :rules="{required: true, message: '请输入-著作教材-类别', trigger: 'blur'}">
                                                <el-input placeholder="请输入类别" v-model="item.b_class"></el-input>
                                            </el-form-item>
                                        </el-col>
                                        <el-col :xs="12" :sm="10" :md="8" :lg="6" :xl="5">
                                            <el-form-item label="出版社" :prop="`rm_book.${index}.b_publisher`" :rules="{required: true, message: '请输入-著作教材-出版社', trigger: 'blur'}">
                                                <el-input placeholder="请输入出版社" v-model="item.b_publisher"></el-input>
                                            </el-form-item>
                                        </el-col>
                                        <el-col :xs="12" :sm="10" :md="8" :lg="6" :xl="5">
                                            <el-form-item label="级别" :prop="`rm_book.${index}.b_level`" :rules="{required: true, message: '请输入-著作教材-级别', trigger: 'blur'}">
                                                <el-input placeholder="请输入级别" v-model="item.b_level"></el-input>
                                            </el-form-item>
                                        </el-col>
                                    </el-row>
                                </el-col>
                                <el-col :span="24">
                                    <el-row justify="space-between" :gutter="16">
                                        <el-col :xs="12" :sm="10" :md="8" :lg="6" :xl="5">
                                            <el-form-item label="位次" :prop="`rm_book.${index}.b_position`" :rules="{required: true, message: '请输入-著作教材-位次', trigger: 'blur'}">
                                                <el-input-number placeholder="请输入位次" :min="0" v-model="item.b_position"></el-input-number>
                                            </el-form-item>
                                        </el-col>
                                        <el-col :xs="12" :sm="10" :md="8" :lg="6" :xl="5">
                                            <el-form-item label="出版时间" :prop="`rm_book.${index}.b_time`" :rules="{required: true, message: '请选择-著作教材-出版时间', trigger: 'blur'}">
                                                <el-date-picker placeholder="请选择出版时间" v-model="item.b_time" value-format="YYYY.MM.DD"></el-date-picker>
                                            </el-form-item>
                                        </el-col>
                                        <el-col  :xs="12" :sm="10" :md="8" :lg="6" :xl="5"></el-col>
                                        <el-col  :xs="12" :sm="10" :md="8" :lg="6" :xl="5">
                                            <el-button type="danger" style="margin-top: 34px" @click="remove_btn('book', index)">删除此项</el-button>
                                        </el-col>
                                    </el-row>
                                </el-col>
                                <div class="line"></div>
                            </el-row>
                            <el-button class="add_btn" type="primary" @click="add_btn('book')">添加</el-button>
                        </el-col>
                    </el-row>
                </el-tab-pane>


                <el-tab-pane label="大赛" name="大赛">
                    <el-row justify="center" style="margin-top: 50px">
                        <el-col :xs="24" :sm="22" :md="20" :lg="18" :xl="16">
                            <el-row justify="space-between" v-for="(item, index) of Scientific_Research_Contest_and_Integrated_Curriculum_Reform.rm_competition">
                                <el-col :span="24">
                                    <el-row justify="space-between" :gutter="16">
                                        <el-col  :xs="12" :sm="10" :md="8" :lg="6" :xl="5">
                                            <el-form-item label="时间" :prop="`rm_competition.${index}.c_time`" :rules="{required: true, message: '请选择-大赛-时间', trigger: 'blur'}">
                                                <el-date-picker placeholder="请选择时间" v-model="item.c_time" value-format="YYYY.MM.DD"></el-date-picker>
                                            </el-form-item>
                                        </el-col>
                                        <el-col  :xs="12" :sm="10" :md="8" :lg="6" :xl="5">
                                            <el-form-item label="大赛名称" :prop="`rm_competition.${index}.c_name`" :rules="{required: true, message: '请输入-大赛-名称', trigger: 'blur'}">
                                                <el-input placeholder="请输入大赛名称" v-model="item.c_name"></el-input>
                                            </el-form-item>
                                        </el-col>
                                        <el-col  :xs="12" :sm="10" :md="8" :lg="6" :xl="5">
                                            <el-form-item label="级别" :prop="`rm_competition.${index}.c_level`" :rules="{required: true, message: '请输入-大赛-级别', trigger: 'blur'}">
                                                <el-input placeholder="请输入级别" v-model="item.c_level"></el-input>
                                            </el-form-item>
                                        </el-col>
                                        <el-col  :xs="12" :sm="10" :md="8" :lg="6" :xl="5">
                                            <el-form-item label="指导/参加" :prop="`rm_competition.${index}.isguide`" :rules="{required: true, message: '请选择-大赛-指导/参加', trigger: 'blur'}">
                                                <el-radio-group v-model="item.isguide">
                                                    <el-radio-button :label="true">指导</el-radio-button>
                                                    <el-radio-button @click="item.c_studentname=''" :label="false">参加</el-radio-button>
                                                </el-radio-group>
                                            </el-form-item>
                                        </el-col>
                                    </el-row>
                                </el-col>
                                <el-col :span="24">
                                    <el-row justify="space-between" :gutter="16">
                                        <el-col :xs="12" :sm="10" :md="8" :lg="6" :xl="5">
                                            <el-form-item label="项目名称" :prop="`rm_competition.${index}.c_projectname`" :rules="{required: true, message: '请输入-大赛-项目名称', trigger: 'blur'}">
                                                <el-input placeholder="请输入项目名称" v-model="item.c_projectname"></el-input>
                                            </el-form-item>
                                        </el-col>
                                        <el-col :xs="12" :sm="10" :md="8" :lg="6" :xl="5">
                                            <el-form-item label="获奖名次" :prop="`rm_competition.${index}.c_rank`" :rules="{type: 'array', required: true, fields: {
                                                0: {type: 'number', required: true, message: '请选择-大赛-奖项'},
                                                1: {type: 'number', required: true, message: '请输入-大赛-名次'}
                                            }, len: 2, message: '请选择-大赛-获奖名次'}">
                                                <el-col :span="12" style="padding: 0">
                                                    <el-select v-model="item.c_rank[0]" placeholder="请选择">
                                                        <el-option label="一等奖" :value="1" :key="1"></el-option>
                                                        <el-option label="二等奖" :value="2" :key="2"></el-option>
                                                        <el-option label="三等奖" :value="3" :key="3"></el-option>
                                                    </el-select>
                                                </el-col>
                                                <el-col  :span="12" style="padding: 0">
                                                    <el-input-number style="width: 100%" controls-position="right" placeholder="获奖名次" :min="0" v-model="item.c_rank[1]"></el-input-number>
                                                </el-col>
                                            </el-form-item>
                                        </el-col>
                                        <el-col  :xs="12" :sm="10" :md="8" :lg="6" :xl="5">
                                            <el-form-item label="获奖学生" :prop="`rm_competition.${index}.c_studentname`" :rules="item.isguide ? {required: true, message: '请输入-大赛-获奖学生', trigger: 'blur'} : ''">
                                                <el-input :placeholder="item.isguide ? '请输入获奖学生':''" v-model="item.c_studentname" :disabled="!item.isguide"></el-input>
                                            </el-form-item>
                                        </el-col>
                                        <el-col  :xs="12" :sm="10" :md="8" :lg="6" :xl="5">
                                            <el-button type="danger" style="margin-top: 34px" @click="remove_btn('competition', index)">删除此项</el-button>
                                        </el-col>
                                    </el-row>
                                </el-col>
                                <div class="line"></div>
                            </el-row>
                            <el-button class="add_btn" type="primary" @click="add_btn('competition')">添加</el-button>
                        </el-col>
                    </el-row>
                </el-tab-pane>


                <el-tab-pane label="学院教学能力比赛" name="学院教学能力比赛">
                    <el-row justify="center" style="margin-top: 50px">
                        <el-col :xs="24" :sm="22" :md="20" :lg="18" :xl="16">
                            <el-row justify="space-between" v-for="(item, index) of Scientific_Research_Contest_and_Integrated_Curriculum_Reform.rm_teachcompetition">
                                <el-col :span="24">
                                    <el-row justify="space-between">
                                        <el-col :xs="12" :sm="10" :md="8" :lg="6" :xl="4">
                                            <el-form-item label="时间" :prop="`rm_teachcompetition.${index}.tc_time`" :rules="{required: true, message: '请选择-学院教学能力比赛-时间', trigger: 'blur'}">
                                                <el-date-picker placeholder="请选择时间" v-model="item.tc_time" value-format="YYYY.MM.DD"></el-date-picker>
                                            </el-form-item>
                                        </el-col>
                                        <el-col :xs="12" :sm="10" :md="8" :lg="6" :xl="4">
                                            <el-form-item label="名称" :prop="`rm_teachcompetition.${index}.tc_name`" :rules="{required: true, message: '请输入-学院教学能力比赛-名称', trigger: 'blur'}">
                                                <el-input placeholder="请输入名称" v-model="item.tc_name"></el-input>
                                            </el-form-item>
                                        </el-col>
                                        <el-col :xs="12" :sm="10" :md="8" :lg="6" :xl="4">
                                            <el-form-item label="级别" :prop="`rm_teachcompetition.${index}.tc_level`" :rules="{required: true, message: '请输入-学院教学能力比赛-级别', trigger: 'blur'}">
                                                <el-input placeholder="请输入级别" v-model="item.tc_level"></el-input>
                                            </el-form-item>
                                        </el-col>
                                        <el-col :xs="12" :sm="10" :md="8" :lg="6" :xl="4">
                                            <el-form-item label="成绩" :prop="`rm_teachcompetition.${index}.tc_score`" :rules="{required: true, message: '请输入-学院教学能力比赛-成绩', trigger: 'blur'}">
                                                <el-input placeholder="请输入成绩" v-model="item.tc_score"></el-input>
                                            </el-form-item>
                                        </el-col>
                                        <el-col :xs="12" :sm="10" :md="8" :lg="6" :xl="4">
                                            <el-button type="danger" style="margin-top: 34px" @click="remove_btn('teachcompetition', index)">删除此项</el-button>
                                        </el-col>
                                    </el-row>
                                </el-col>
                                <div class="line"></div>
                            </el-row>
                            <el-button class="add_btn" type="primary" @click="add_btn('teachcompetition')">添加</el-button>
                        </el-col>
                    </el-row>
                </el-tab-pane>


                <el-tab-pane label="一体化教师层级认定" name="一体化教师层级认定">
                    <el-row justify="center" style="margin-top: 50px">
                        <el-col :xs="24" :sm="22" :md="20" :lg="18" :xl="16">
                            <el-row justify="space-around" :gutter="16">
                                <el-col :xs="8" :sm="8" :md="8" :lg="6" :xl="5">
                                    <el-form-item label="认证时间">
                                        <el-date-picker placeholder="请选择时间" v-model="Scientific_Research_Contest_and_Integrated_Curriculum_Reform.rm_authenticationtime" value-format="YYYY.MM.DD"></el-date-picker>
                                    </el-form-item>
                                </el-col>
                                <el-col :xs="8" :sm="8" :md="8" :lg="6" :xl="5">
                                    <el-form-item label="认证等级">
                                        <el-input placeholder="请输入认证等级" v-model="Scientific_Research_Contest_and_Integrated_Curriculum_Reform.rm_authenticationlevel"></el-input>
                                    </el-form-item>
                                </el-col>
                                <el-col :xs="8" :sm="8" :md="8" :lg="6" :xl="5">
                                    <el-form-item label="是否通过">
                                        <el-radio-group v-model="Scientific_Research_Contest_and_Integrated_Curriculum_Reform.ispass">
                                            <el-radio-button :label="true">通过</el-radio-button>
                                            <el-radio-button :label="false">未通过</el-radio-button>
                                        </el-radio-group>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                        </el-col>
                    </el-row>
                </el-tab-pane>


                <el-tab-pane label="一体化课程改革" name="一体化课程改革">
                    <el-row justify="center" style="margin-top: 50px">
                        <el-col :xs="24" :sm="22" :md="20" :lg="18" :xl="16">
                            <el-row justify="space-between" v-for="(item, index) of Scientific_Research_Contest_and_Integrated_Curriculum_Reform.rm_coursereform">
                                <el-col :span="24">
                                    <el-row justify="space-between" :gutter="16">
                                        <el-col :xs="12" :sm="10" :md="8" :lg="6" :xl="5">
                                            <el-form-item label="名称" :prop="`rm_coursereform.${index}.cr_name`" :rules="{required: true, message: '请输入-一体化课程改革-名称', trigger: 'blur'}">
                                                <el-input placeholder="请输入名称" v-model="item.cr_name"></el-input>
                                            </el-form-item>
                                        </el-col>
                                        <el-col :xs="12" :sm="10" :md="8" :lg="6" :xl="5">
                                            <el-form-item label="级别" :prop="`rm_coursereform.${index}.cr_level`" :rules="{required: true, message: '请输入-一体化课程改革-级别', trigger: 'blur'}">
                                                <el-input placeholder="请输入级别" v-model="item.cr_level"></el-input>
                                            </el-form-item>
                                        </el-col>
                                        <el-col :xs="12" :sm="10" :md="8" :lg="6" :xl="5">
                                            <el-form-item label="立项单位" :prop="`rm_coursereform.${index}.cr_company`" :rules="{required: true, message: '请输入-一体化课程改革-立项单位', trigger: 'blur'}">
                                                <el-input placeholder="请输入立项单位" v-model="item.cr_company"></el-input>
                                            </el-form-item>
                                        </el-col>
                                        <el-col :xs="12" :sm="10" :md="8" :lg="6" :xl="5">
                                            <el-form-item label="主持/参与" :prop="`rm_coursereform.${index}.ishost`" :rules="{required: true, message: '请选择-一体化课程改革-是否主持', trigger: 'blur'}">
                                                <el-radio-group v-model="item.ishost">
                                                    <el-radio-button :label="true">主持</el-radio-button>
                                                    <el-radio-button :label="false">参与</el-radio-button>
                                                </el-radio-group>
                                            </el-form-item>
                                        </el-col>
                                    </el-row>
                                </el-col>
                                <el-col :span="24">
                                    <el-row justify="space-between" :gutter="16">
                                        <el-col :xs="12" :sm="10" :md="8" :lg="6" :xl="5">
                                            <el-form-item label="立项时间" :prop="`rm_coursereform.${index}.cr_starttime`" :rules="{required: true, message: '请选择-一体化课程改革-立项时间', trigger: 'blur'}">
                                                <el-date-picker placeholder="请选择立项时间" v-model="item.cr_starttime" value-format="YYYY.MM.DD"></el-date-picker>
                                            </el-form-item>
                                        </el-col>
                                        <el-col :xs="12" :sm="10" :md="8" :lg="6" :xl="5">
                                            <el-form-item label="结项时间" :prop="`rm_coursereform.${index}.cr_endtime`" :rules="{required: true, message: '请选择-一体化课程改革-结项时间', trigger: 'blur'}">
                                                <el-date-picker placeholder="请选择结项时间" v-model="item.cr_endtime" value-format="YYYY.MM.DD"></el-date-picker>
                                            </el-form-item>
                                        </el-col>
                                        <el-col :xs="12" :sm="10" :md="8" :lg="6" :xl="5"></el-col>
                                        <el-col :xs="12" :sm="10" :md="8" :lg="6" :xl="5">
                                            <el-button type="danger" style="margin-top: 34px" @click="remove_btn('coursereform', index)">删除此项</el-button>
                                        </el-col>
                                    </el-row>
                                </el-col>
                                <div class="line"></div>
                            </el-row>
                            <el-button class="add_btn" type="primary" @click="add_btn('coursereform')">添加</el-button>
                        </el-col>
                    </el-row>
                </el-tab-pane>
            </el-scrollbar>
        </el-tabs>

        <el-affix position="bottom" :offset="0">
            <el-button style="position: absolute;bottom: 50px;right: 10%" @click="submit" type="success" :loading="isLoading">提交 “科研大赛与一体化课改”</el-button>
        </el-affix>
    </el-form>
</template>

<script>
import {ElLoading, ElMessage} from "element-plus";
import useStore from "../../store/store";
import login from "../../views/Login.vue";

const store = useStore()
export default {
    name: "Scientific_Research_Contest_and_Integrated_Curriculum_Reform",
    data() {
        return {
            Scientific_Research_Contest_and_Integrated_Curriculum_Reform: {
                user_id: store.user_id,
                rm_scienceresearch: [               // 科研课题表
                    {
                        user_id: store.user_id,
                        s_name: '',                 // 名称
                        s_level: '',                // 级别
                        s_initiationunit: '',       // 立项单位
                        s_starttime: '',            // 立项时间
                        s_endtime: '',              // 结项时间
                        s_number: '',               // 共几人
                        s_position: '',             // 第几位
                        s_ishost: false,            // 是否主持/参与？
                    }
                ],
                rm_paper: [                         // 论文
                    {
                        user_id: store.user_id,
                        p_name: '',                 // 名称
                        p_level: '',                // 等级
                        p_publisher: '',            // 刊物/出版社
                        p_rank: '',                 // 级别
                        p_time: '',                 // 时间
                        p_number: '',               // 共*人
                        p_position: '',             // 第*位
                    }
                ],
                rm_patent: [                        // 专利
                    {
                        user_id: store.user_id,
                        pa_name: '',                // 名称
                        pa_class: '',               // 类别
                        pa_time: '',                // 时间
                        pa_position: '',            // 位次
                    }
                ],
                rm_book: [                          // 著作教材
                    {
                        user_id: store.user_id,
                        b_name: '',                 // 著作教材名称
                        b_class: '',                // 类别
                        b_publisher: '',            // 出版社
                        b_level: '',                // 级别
                        b_position: '',             // 位次
                        b_time: '',                 // 出版时间
                    }
                ],
                rm_competition: [                   // 大赛
                    {
                        user_id: store.user_id,
                        c_time: '',                 // 时间
                        c_name: '',                 // 名称
                        c_level: '',                // 级别
                        c_projectname: '',          // 项目名称
                        c_rank: [],                 // 获奖名次
                        c_studentname: '',          // 获奖学生
                        isguide: false              // 是否指导大赛 true -> 指导 false -> 参加
                    }
                ],
                rm_teachcompetition: [              // 学院教学能力比赛
                    {
                        user_id: store.user_id,
                        tc_time: '',                // 时间
                        tc_name: '',                // 名称
                        tc_level: '',               // 级别
                        tc_score: '',               // 成绩
                    }
                ],
                rm_coursereform: [                  // 一体化课程改革
                    {
                        user_id: store.user_id,
                        cr_name: '',                // 课改课题名称
                        cr_level: '',               // 级别
                        cr_company: '',             // 立项单位
                        cr_starttime: '',           // 立项时间
                        cr_endtime: '',             // 结项时间
                        ishost: true,               // true -> 主持；false -> 参与
                    }
                ],
                // ------ 一体化教师层级认定 ------
                rm_authenticationtime: '',          // 时间
                rm_authenticationlevel: '',         // 等级
                ispass: ''                        // 是否通过
            },
            isLoading: false,
            ActiveTab: '科研课题'
        }
    },
    methods: {
        add_btn(type) {
            if (type === 'scienceresearch') {
                this.Scientific_Research_Contest_and_Integrated_Curriculum_Reform.rm_scienceresearch.push({
                    user_id: store.user_id,
                    s_name: '',                 // 名称
                    s_level: '',                // 级别
                    s_initiationunit: '',       // 立项单位
                    s_starttime: '',            // 立项时间
                    s_endtime: '',              // 结项时间
                    s_number: '',               // 共几人
                    s_position: '',             // 第几位
                    s_ishost: false,            // 是否主持/参与？
                })
            } else if (type === 'paper') {
                this.Scientific_Research_Contest_and_Integrated_Curriculum_Reform.rm_paper.push({
                    user_id: store.user_id,
                    p_name: '',                 // 名称
                    p_level: '',                // 等级
                    p_publisher: '',            // 刊物/出版社
                    p_rank: '',                 // 级别
                    p_time: '',                 // 时间
                    p_number: '',               // 共*人
                    p_position: '',             // 第*位
                })
            } else if (type === 'patent') {
                this.Scientific_Research_Contest_and_Integrated_Curriculum_Reform.rm_patent.push({
                    user_id: store.user_id,
                    pa_name: '',                // 名称
                    pa_class: '',               // 类别
                    pa_time: '',                // 时间
                    pa_position: '',            // 位次
                })
            } else if (type === 'book') {
                this.Scientific_Research_Contest_and_Integrated_Curriculum_Reform.rm_book.push({
                    user_id: store.user_id,
                    b_name: '',                 // 著作教材名称
                    b_class: '',                // 类别
                    b_publisher: '',            // 出版社
                    b_level: '',                // 级别
                    b_position: '',             // 位次
                    b_time: '',                 // 出版时间
                })
            } else if (type === 'competition') {
                this.Scientific_Research_Contest_and_Integrated_Curriculum_Reform.rm_competition.push({
                    user_id: store.user_id,
                    c_time: '',                 // 时间
                    c_name: '',                 // 名称
                    c_level: '',                // 级别
                    c_projectname: '',          // 项目名称
                    c_rank: [],                 // 获奖名次
                    c_studentname: '',          // 获奖学生
                    isguide: false              // 是否指导大赛 true -> 指导 false -> 参加
                })
            } else if (type === 'teachcompetition') {
                this.Scientific_Research_Contest_and_Integrated_Curriculum_Reform.rm_teachcompetition.push({
                    user_id: store.user_id,
                    tc_time: '',                // 时间
                    tc_name: '',                // 名称
                    tc_level: '',               // 级别
                    tc_score: '',               // 成绩
                })
            } else if (type === 'coursereform') {
                this.Scientific_Research_Contest_and_Integrated_Curriculum_Reform.rm_coursereform.push({
                    user_id: store.user_id,
                    cr_name: '',                // 课改课题名称
                    cr_level: '',               // 级别
                    cr_company: '',             // 立项单位
                    cr_starttime: '',           // 立项时间
                    cr_endtime: '',             // 结项时间
                    ishost: true,               // true -> 主持；false -> 参与
                })
            }
        },
        remove_btn(type, index) {
            if (type === 'scienceresearch') {
                this.Scientific_Research_Contest_and_Integrated_Curriculum_Reform.rm_scienceresearch.splice(index, 1)
            } else if (type === 'paper') {
                this.Scientific_Research_Contest_and_Integrated_Curriculum_Reform.rm_paper.splice(index, 1)
            } else if (type === 'patent') {
                this.Scientific_Research_Contest_and_Integrated_Curriculum_Reform.rm_patent.splice(index, 1)
            } else if (type === 'book') {
                this.Scientific_Research_Contest_and_Integrated_Curriculum_Reform.rm_book.splice(index, 1)
            } else if (type === 'competition') {
                this.Scientific_Research_Contest_and_Integrated_Curriculum_Reform.rm_competition.splice(index, 1)
            } else if (type === 'teachcompetition') {
                this.Scientific_Research_Contest_and_Integrated_Curriculum_Reform.rm_teachcompetition.splice(index, 1)
            } else if (type === 'coursereform') {
                this.Scientific_Research_Contest_and_Integrated_Curriculum_Reform.rm_coursereform.splice(index, 1)
            }
        },
        submit() {
            this.$refs.Scientific_Research_Contest_and_Integrated_Curriculum_Reform_form.validate((validate, message) => {
                if (!validate) {
                    this.ActiveTab = message[Object.keys(message)[0]][0].message.split('-')[1]
                    ElMessage.error(`表单验证未通过-> ${message[Object.keys(message)[0]][0].message}`)
                    return false
                }
                for (const rmCompetitionElement of this.Scientific_Research_Contest_and_Integrated_Curriculum_Reform.rm_competition) {
                    rmCompetitionElement.c_rank = rmCompetitionElement.c_rank instanceof Array ? rmCompetitionElement.c_rank.join(':') : rmCompetitionElement.c_rank
                }
                this.push()
                for (const rmCompetitionElement of this.Scientific_Research_Contest_and_Integrated_Curriculum_Reform.rm_competition) {
                    rmCompetitionElement.c_rank = rmCompetitionElement.c_rank.split(':').map(Number)
                }
            })
        },
        push() {
            this.Scientific_Research_Contest_and_Integrated_Curriculum_Reform.type = "5002"
            this.isLoading = true
            this.Scientific_Research_Contest_and_Integrated_Curriculum_Reform.user_id = store.user_id
            this.$api.pushTeacherResearchReformData(this.Scientific_Research_Contest_and_Integrated_Curriculum_Reform).then(
                response => {
                    if (response.data.isSaved === true) {
                        ElMessage.success({
                            message: '科研大赛与一体化课改提交成功！'
                        })
                    } else {
                        ElMessage.error({
                            message: '提交失败'
                        })
                    }
                    this.isLoading = false
                },
                error => {
                    console.log(error)
                    ElMessage.error({
                        message: error.message
                    })
                    this.isLoading = false
                }
            )
        }
    },
    mounted() {
        const loading = ElLoading.service({
            target: document.querySelector('.el-main'),
            text: '请稍候...'
        })
        this.$api.pullTeacherResearchReformData(store.user_id).then(
            response => {
                for (const rmCompetitionElement of response.data.rm_competition) {
                    rmCompetitionElement.c_rank = rmCompetitionElement.c_rank.indexOf(':') !== -1 ? rmCompetitionElement.c_rank.split(':').map(Number) : []
                }
                this.Scientific_Research_Contest_and_Integrated_Curriculum_Reform = response.data
                loading.close()
            },
            error => {
                console.log(error)
                ElMessage.error(`${error.message}---- 请求数据失败`)
                loading.close()
            }
        )
    }
}
</script>

<style scoped>

</style>